<% layout('/layouts/default.html', {title: '评分明细查看', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<#form:form id="searchForm" model="${dcSupExamInfo}" action="${ctx}/score/dcSupExamSumScore/sumScoreListData" method="post" class="form-inline "
			data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
			<div style="float: right">
<!--				<div class="form-group">-->
<!--					<label class="control-label">${text('年度')}：</label>-->
<!--					<div class="control-inline width-120">-->
<!--						<#form:select path="examYear" items="${yearList}" blankOption="true" data-placeholder="请选择" itemLabel="yearLabel" itemValue="yearValue" class="form-control width-120" defaultValue="${currentYear}"/>-->
<!--					</div>-->
<!--				</div>-->
				<div class="form-group">
					<label class="control-label">${text('考核标题')}：</label>
					<div class="control-inline width-160">
						<#form:input path="examTitle" maxlength="100" class="form-control width-160" placeholder="请输入考核标题"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button onclick="cz();" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</div>
		</#form:form>
	</div>
	<div class="box-body">
		<table id="dataGrid"></table>
		<div id="dataGridPage"></div>
	</div>
</div>
</div>
<% } %>
<script>
	function cz(){
		searchForm.reset();
		$('#dataGrid').dataGrid('reloadGrid');
	}
	// 初始化DataGrid对象
	$('#dataGrid').dataGrid({
		showRownum: false,
		searchForm: $("#searchForm"),
		columnModel: [
			{header:'${text("id")}',hidden: true, name:'id',width:150, align:"left", frozen:true},
			{header:'${text("考核年度")}', name:'examYear', index:'a.exam_year', width:150, align:"center"},
			{header:'${text("考核标题")}', name:'examTitle', index:'a.exam_title', width:150, align:"left"},
			{header:'${text("发布时间")}', name:'createDate', index:'a.exam_progress', width:150, align:"left"},
			{header:'${text("操作")}', name:'actions',align: "center", width:200, formatter: function(val, obj, row, act){
					var actions = [];
					let examId="'"+row.id+"'";
					actions.push('<a  onclick=isGoLink('+examId+',"单项指标查看") href="javascript:;"  class="btn btn-primary btn-xs" title="${text("单项指标查看")}"><span>查看</span></a>&emsp;');
					return actions.join('');
				}}
		],
		// 加载成功后执行事件
		ajaxSuccess: function(data){

		}
	});

	function isGoLink(examId,title){
		$.ajax({
			url:"${ctx}/notice/dcSupExamNotice/isNotSendMessage",    //请求的url地址
			dataType:"json",
			async:false,
			data:{"examId":examId},
			type:"GET",
			success:function(req){
				if(req==0){
					js.alert('当前评分未发送评分通知！', {icon: 2}, function(){})
				}else{
					js.addTabPage(null, title, '${ctx}/score/dcSupExamDXZBScore/readDXListView?&id=' + examId,true,true);
				}
			},
		});
	}
</script>